<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Edit User</title>
<LINK REL="SHORTCUT ICON" HREF="<%=basePath %>web/images/e5/logo.jpg">
<link rel="stylesheet" href="<%=basePath%>web/css/base.css" />
<script type="text/javascript"
	src="<%=basePath%>web/js/jquery-1.4.4.min.js"></script>
<script src="<%=basePath%>web/js/vanadium.js"></script>
<script src="<%=basePath%>web/js/regular.js"></script>
	<style>

</style>
</head>
<body>


	<div id="d_head">
		<h1>Welcome,${sessionScope.accountInfo.userID} </h1>
		<h2>
			<span><a title="Log in" href="<%=basePath%>quit.action">Log out</a> </span>
			<span><a title="User Profile" href="<%=basePath%>listuser.action">User Profile</a> </span>
			
		</h2>
	</div>
	<div class="return"></div>
	<div id="demo">
		  <form id="iform" action="com/saveuser.action" method="post">
			<fieldset>
				<legend>Edit user</legend>				
				<table align="center">
					<s:iterator value="user" var="user" step="1">
					<input type="hidden" name="id" value="<s:property value="#user.id"/>"></input>
					<input type="hidden" name="userID" value="<s:property value="#user.userID"/>"></input>
					
					<tr>
						<th>First Name:</th>
						<td><input type="text" name="firstName" class=":required :alpha :max_length;30" value="<s:property value="#user.firstName"/>"></input></td>
					</tr>
					<tr>
						<th>Last Name:</tf>
						<td><input type="text" name="lastName" class=":required :alpha :max_length;30" value="<s:property value="#user.lastName"/>"></input></td>
					</tr>
					<tr>
						<th>Address1:</th>
						<td><input type="text" name="addr1" class=":max_length;50" value="<s:property value="#user.addr1"/>"></input></td>
					</tr>
					<tr>
						<th>Address2:</th>
						<td><input type="text" name="addr2" class=":max_length;50" value="<s:property value="#user.addr2"/>"></input></td>
					</tr>
					<tr>
						<th>City:</th>
						<td><input type="text" name="city" value="<s:property value="#user.city"/>"></input></td>
					</tr>
					<tr>
						<th>State/Province:</th>
						<td><input type="text" name="state" value="<s:property value="#user.state"/>"></input></td>
					</tr>
					<tr>
						<th>Zip/Post Code:</th>
						<td><input type="text" name="zip" class=":number :max_lenth;10" value="<s:property value="#user.zip"/>"></input></td>
					</tr>
					<tr>
						<th>Country:</th>
						<td><input type="text" name="country" value="<s:property value="#user.country"/>"></input></td>
					</tr>
					<tr>
						<th>User Authority:</th>
						<td><s:select name="userAuth" list="#{1:'SuperUser',2:'Administrator',3:'Domestic Consumer'}" listKey="key" listValue="value" value="#user.userAuth" />
						</td>
					</tr>
					<tr>
						<th>Title:</th>
						<td><input type="text" name="title" class=":alpha :max_length;20" value="<s:property value="#user.title"/>"></input></td>
					</tr>
					<tr>
						<th>UserId:</th>
						<td><input id="userid" type="text" name="userid" class=":required :alpha :max_length;10 :min_length;6 :ajax;userValiad.action" value="<s:property value="#user.userID"/>"></input></td>
					</tr>
					<tr>
						<th>Password:</th>
						<td><input id="checkpsw" type="password" name="password" class=":required :pass" value="<s:property value="#user.password"/>"></input></td>
					</tr>
					<tr>
						<th>Confirm Password:</th>
						<td><input type="password" name="repassword" class=":required :same_as;checkpsw" value="<s:property value="#user.password"/>"></input></td>
					</tr>
					<tr>
						<th></th>
						<td>
							<input type="submit" value="Submit"> 
							
						</td>
					</tr>
					</s:iterator>
					
				</table>
			</fieldset>
			
	</form> 
	</div>
	<div id="footer" class="pa tc pb5">E5 &copy;2012</div>
</body>
</html>